<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('zhengshu'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>证书管理</title>
<link href="templates/style/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="templates/js/jquery.min.js"></script>
<script type="text/javascript" src="templates/js/loadimage.js"></script>
<script type="text/javascript" src="templates/js/forms.func.js"></script>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="ui/css/bootstrap.min.css">
<link rel="stylesheet" href="ui/css/bootstrap-theme.min.css" >
<script src="/bootstrap/js/bootstrap.min.js" ></script>
</head>
<body>
<?php 
$dosql->Execute("SELECT `id` FROM `#@__sn` WHERE  1     ",6);
$all_num=$dosql->GetTotalRow(6); //报修完成
?>
<div class="topToolbar"> <span class="title">序列号管理  （共<?php echo $all_num; ?>个记录）</span> <a href="javascript:location.reload();" class="reload">刷新</a></div>
<form name="form" id="form" method="post" action="">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable table-bordered">
		<tr align="center" class="head">
			<td width="3%" height="36" class="firstCol"><input type="checkbox" name="checkid" id="checkid" onclick="CheckAll(this.checked);"></td>
			<td width="4%">ID</td>
            <td width="15%">设备编号</td>
            <td width="10%">设备类型</td>
			<td width="10%">是否出厂</td>
            <td width="8%">入库时间</td>
            <td width="10%">使用单位</td>
            <td width="10%">质保时间</td>
            <td width="10%">下载条形码</td>
            <td width="5%">被查询次数</td>
			<td width="10%" class="endCol">操作</td>
		</tr>
		<?php
		$sql = "SELECT * FROM `#@__sn` WHERE  1  ";
		$dopage->GetPage($sql,10);
		while($row = $dosql->GetArray())
		{
			
			switch($row['checkinfo'])
			{
				case 'true':
					$checkinfo = '已出厂';
					$c_color='green';
					break;  
				case 'false':
					$checkinfo = '未出厂';
					$c_color='red';
					break;
				default:
					$checkinfo = '没有获取到参数';
			}
			$ma="/ma/".$row['sn'].".png";
		?>
		<tr align="center" class="dataTr">
			<td height="40" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php echo $row['id']; ?>" /></td>
			<td><?php echo $row['id']; ?></td>
            <td><?php echo $row['sn']; ?></td>
            <td><?php echo $row['typename']; ?></td>
            <td><a  class="<?php echo $c_color;?>" href="zhengshu_save.php?id=<?php echo $row['id']; ?>&action=check&checkinfo=<?php echo $row['checkinfo']; ?>" title="点击进行审核与未审操作"><?php echo $checkinfo; ?></a></td>
             <td><?php echo date("Y-m-d H:i:s",$row['input_time']); ?></td>
            <td><?php echo $row['school']; ?></td>
            <td><i class="glyphicon glyphicon-off green"></i>   <?php echo date("Y-m-d",$row['start_time'])."<i class=' red glyphicon glyphicon-random'></i>   ".date("Y-m-d",$row['end_time']); ?></td>
            <td><a href="getFile.php?pic=<?php echo $ma;?>" ><img width="80" src="<?php echo $ma; ?>" /></a></td>
			<td><?php echo $row['hits']; ?></td>
			<td class="action endCol"> <span><a href="zhengshu_update.php?id=<?php echo $row['id']; ?>">修改</a></span> | <span class="nb"><a href="zhengshu_save.php?action=del2&id=<?php echo $row['id'] ?>" onclick="return ConfDel(2);">删除</a></span></td>
		</tr>
		<?php
		}	
		?>
	</table>
</form>
<?php

//判断无记录样式
if($dosql->GetTotalRow() == 0)
{
	echo '<div class="dataEmpty">暂时没有相关的记录</div>';
}
?>
<div class="bottomToolbar"><span class="selArea"><span>选择：</span> <a href="javascript:CheckAll(true);">全部</a> - <a href="javascript:CheckAll(false);">无</a> - <a href="javascript:DelAll('zhengshu_save.php');" onclick="return ConfDel(0);">删除</a></span> <a href="zhengshu_add.php" class="dataBtn btn btn-danger">添加设备序列号</a> </div>
<div class="page"> <?php echo $dopage->GetList(); ?> </div>
<?php

//判断是否启用快捷工具栏
if($cfg_quicktool == 'Y')
{
?>
<div class="quickToolbar">
	<div class="qiuckWarp">
		<div class="quickArea"><span class="selArea"><span>选择：</span> <a href="javascript:CheckAll(true);">全部</a> - <a href="javascript:CheckAll(false);">无</a> - <a href="javascript:DelAll('zhengshu_save.php');" onclick="return ConfDel(0);">删除</a></span> <a href="zhengshu_add.php" class="dataBtn btn btn-danger">添加设备序列号</a><span class="pageSmall">
			<?php echo $dopage->GetList(); ?>
			</span></div>
		<div class="quickAreaBg"></div>
	</div>
</div>
<?php
}
?>
</body>
</html>